fix(cli): drop redundant identify from identity stitch#5396
Open
seanoliver wants to merge 1 commit into
Open
Conversation
The Go StitchLogin and TS X-Gotrue-Id interception both fired $create_alias and $identify(distinctID, nil) back-to-back on first stitch. The Identify carries no person properties, so $create_alias already owns the device->user merge — the Identify was pure event volume waste (verified: 0 of 638K posthog-go identify events on 2026-05-26 carried $anon_distinct_id linkage). The ephemeral-environment gate from #5366 already handles the spike population; this halves the remaining persistent-laptop stitch volume. GROWTH-890
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Both the Go CLI's
StitchLoginand the TS CLI'sX-Gotrue-Idinterception fire$create_aliasAND$identify(distinctID, nil)back-to-back on a user's first successful stitch. The$identifycarries no person properties, so$create_aliasalready owns the entire device→user merge in the person graph. The Identify is pure event-volume waste.This is the follow-up to #5366. That PR gated stitching in ephemeral environments (CI, Docker, npx) to stop the identify spike. This one tightens the path that still runs — persistent developer laptops — by dropping the redundant call.
We verified the redundancy empirically: of 638K
posthog-go$identifyevents on 2026-05-26, zero carried$anon_distinct_idlinkage, confirming the merge comes entirely from the alias.Changes
s.analytics.Identify(distinctID, nil)fromStitchLogininapps/cli-go/internal/telemetry/service.go.analytics.identify(gotrueId)from the stitch inapps/cli/src/legacy/auth/legacy-platform-api.layer.ts. The TSidentify()may have set default person properties (cli_version,os,arch); accepting that small loss since subsequentcli_*capture events carry the same data as event properties.Aliasfires andIdentifydoes not.Kept the surfaces 1:1 so the Go/TS telemetry parity holds.
identifystays on theAnalyticsinterface — thelogincommand still uses it forcli_login_completed, which is a separate path.Halves the remaining persistent-laptop stitch volume (~15K/day → ~7K/day). No effect on the spike population already handled by #5366.
GROWTH-890